import allure,time
from selenium.webdriver.common.by import By
from page.page_common_steps import PageCommonSteps
from base.base_common import BaseCommon


class PageOrderManagement(PageCommonSteps):
    def __init__(self, driver):
        super().__init__(driver)  # 继承公用方法

        # 元素：点击订单管理
        self.menu_order_management = By.XPATH,"//*[contains(text(), '订单管理')]"
        # 元素：点击订单列表
        self.menu_order_list = By.XPATH, "//*[contains(text(), '订单列表')]"
        # 元素：嵌套iframe元素
        self.switch_page = By.XPATH, "//*[@id='all-menu-iframe']"
        # 元素：创建订单
        self.create_order = By.XPATH, "//span[text()='创建订单']"
        # 元素：学员姓名
        self.student_name = By.XPATH, "//input[@placeholder='请输入学员姓名']"
        # 元素：手机号码
        self.student_number = By.XPATH, "//input[@placeholder='请输入手机号码']"
        # 元素 ：证件类型
        self.certificate_type = By.XPATH, "//input[@class='ivu-select-input']"
        # 元素：选择护照
        self.select_protection = By.XPATH, "//*[text()='护照']"
        # 元素 ：输入证件号码
        self.document_number = By.XPATH, "//input[@placeholder='请输入证件号码']"
        # 元素 ：选择第一个业务归属人
        self.business_owner = By.XPATH, "//li[text() = 'ZG0001']"
        # 元素 ： 线下收费
        self.Offline_charging = By.XPATH, "//*[text() = '线下收费']"
        # 元素 ： 线上订单
        self.online_order = By.XPATH, "//*[text() = '线上收费']"
        # 元素 ： 添加产品
        self.additive_product = By.XPATH, "//*[text() = '添加产品']"
        # 元素 ： 请选择省份
        self.provinces_down_box = By.XPATH, "//*[@placeholder='请选择报考省份']"
        # 元素 ： 选择省份
        self.select_province = By.XPATH, "//*[text() = '广东']"
        # 元素 ： 选择报考城市
        self.city_dropdown_box = By.XPATH, "//*[@placeholder='请选择报考城市']"
        # 元素 ： 选择城市
        self.select_city = By.XPATH, "//*[text() = '广州']"
        # 元素 ： 选择项目类型
        self.select_project_type = By.XPATH, "//*[@placeholder='请选择项目类型']"
        # 元素 ： 选择产品
        self.select_product = By.XPATH, "//*[@placeholder='请输入/选择产品']"
        # 元素 ： 报读考期
        self.date_examination = By.XPATH, "//*[@placeholder='请选择报读考期']"
        # 元素 ： 确定
        self.save_confirm = By.XPATH, "//*[text()='确定']"
        # 元素 ： 确认订单
        self.confirm_order = By.XPATH, "//*[text()='确认订单']"
        # 元素 ：创建订单成功
        self.created_successfully = By.XPATH, "//*[text() = '创建订单成功！']"
        # 元素 ： 输入成交价
        self.transaction_price = By.XPATH, "//*[@class='ivu-input ivu-input-default' and @maxlength='8']"

        # 元素 ：订单收费
        self.order_charge = By.XPATH, "//*[@class='ivu-table-fixed-body']/table/tbody/tr[1]/td[1]/div/div/a[2]"
        # 元素 ：收费方式
        self.collection_manner = By.XPATH, "//*[@class='add-order-form ivu-form ivu-form-label-right']/div[1]/div[4]/div/div/div[1]/div/i"
        # 元素 ：手动收费
        self.manual_charge = By.XPATH, "//*[text() = '手动录入收费信息']"
        # 元素：收费性质
        self.nature_charge = By.XPATH, "//*[@placeholder='请选择收费性质']"
        # 元素：收费金额
        self.charge_amount = By.XPATH, "//*[@placeholder='请输入收费金额']"
        # 元素：收款方
        self.pay_payee = By.XPATH, "//*[@placeholder='请选择收款方']"
        # 元素：测试微信校区
        self.select_recipient = By.XPATH, "//*[text() = '测试微信校区']"
        # 元素：收款渠道
        self.collection_channel = By.XPATH, "//*[text() = '请选择收款渠道']"
        self.collection_channel_1 = By.XPATH, "//*[@placeholder='请选择收款渠道']"
        # 元素：测试渠道
        self.select_collection =  By.XPATH, "//*[text() = '测试渠道']"
        # 元素：确认收费
        self.confirm_receipt = By.XPATH, "//*[text() = '确认收费']"
        # 元素：收费成功
        self.charge_success = By.XPATH, "//span[text()='收费成功！']"

        # 元素：申请售后
        self.after_sales = By.XPATH, "//*[@class='ivu-table-fixed-body']/table/tbody/tr[1]/td[1]/div/div/a[3]"
        # 元素：扣费说明
        self.deduction_statement = By.XPATH, "//*[@class='info-contain']/div[2]/form/div/div[2]/div[1]/div/textarea"
        # 元素：扣费金额
        self.amount_deduction = By.XPATH, "//*[@placeholder='请输入扣费金额']"
        # 元素：下一步
        self.next_step = By.XPATH, "//*[@class='text-center']/button[3]"
        # 元素：选择合作校区
        self.partner_campus = By.XPATH, "//*[@placeholder='请选择合作校区']"
        # 元素：选购产品
        self.shopping_goods = By.XPATH, "//*[@placeholder='请输入/选择产品']"
        # 元素：报考省份
        self.applicant_province = By.XPATH, "//*[@placeholder='请选择报考省份']"
        # 元素： 报考城市
        self.applicant_city = By.XPATH, "//*[@placeholder='请选择报考城市']"
        # 元素：订单金额
        self.order_amount = By.XPATH, "//*[@class='ivu-table-tbody']/tr/td[6]/div/div/input"
        # 元素：退费为否
        self.refund_no = By.XPATH, "//*[@class='ivu-card-body']/div[5]/div/div/div/div/label[2]/span/input"
        # 元素： 下一步
        self.next_step1 = By.XPATH, "//*[@class='text-center']/button[3]"
        # 元素： 应退个人金额
        self.personal_refund = By.XPATH, "//*[@class='ivu-form-item ivu-form-item-required ivu-form-item-error']/div/div[1]/input"
        # 元素：保存
        self.save_success = By.XPATH, "//*[@class='text-center']/button[4]"
        # 元素：保存成功
        self.save_successfully = By.XPATH, "//*[text () = '保存成功']"
        # 元素：申请时间
        self.time_application = By.XPATH, "//*[text() = '申请时间']"


        # 元素：退学退费
        self.withdrawal_fee = By.XPATH, "//*[@class='applyBox']/div[1]/div[1]/div/div/div/div/div[3]"
        # 元素：退学退费-扣费说明
        self.refund_instructions = By.XPATH,"//*[@class='applyBox']/div[1]/div[2]/div[2]/div/div[2]/form/div/div[2]/div/div/textarea"
        # 元素：应退个人金额
        self.refun_dable_amount = By.XPATH, "//*[@class='applyBox']/div[1]/div[2]/div[2]/div/div[3]/form/div/div[3]/div/div/div/input"
        # 元素：收款方
        self.return_payee = By.XPATH, "//*[@class='applyBox']/div[1]/div[2]/div[2]/div/div[3]/form/div/div[4]/div[1]/div[1]/div/div/div/input"
        # 元素：收款渠道
        self.returt_collection_channel = By.XPATH, "//*[@class='applyBox']/div[1]/div[2]/div[2]/div[1]/div[3]/form/div/div[4]/div[1]/div[2]/div/div/div/div[1]/div/input"
        # 元素：收款账号
        self.return_account_number = By.XPATH, "//*[@class='applyBox']/div[1]/div[2]/div[2]/div[1]/div[3]/form/div/div[4]/div[1]/div[3]/div/div/div/input"
        # 元素：保存
        self.returnt_save = By.XPATH, "//*[@class='applyBox']/div[2]/button[1]/span"


        # 元素：仅退费
        self.refund_only = By.XPATH, "//*[@class='applyBox']/div[1]/div[1]/div/div/div/div/div[4]"
        # 元素：仅退费-扣费说明
        self.only_dable_amount = By.XPATH, "//*[@class='applyBox']/div[1]/div[2]/div[3]/div/div[2]/form/div/div[1]/div/div/textarea"
        # 元素：仅退费-应退个人金额
        self.only_dable_amoun = By.XPATH, "//*[@class='applyBox']/div[1]/div[2]/div[3]/div/div[2]/form/div/div[3]/div/div/div[1]/input"
        # 元素：仅退费-收款方
        self.only_payee = By.XPATH, "//*[@class='applyBox']/div[1]/div[2]/div[3]/div/div[2]/form/div/div[4]/div[1]/div[1]/div/div/div/input"
        # 元素：仅退费-收款渠道
        self.only_ollection_channel = By.XPATH, "//*[@class='applyBox']/div[1]/div[2]/div[3]/div/div[2]/form/div/div[4]/div[1]/div[2]/div/div/div/div[1]/div/input"
        # 元素：仅退费-收款账号
        self.only_account_number = By.XPATH, "//*[@class='applyBox']/div[1]/div[2]/div[3]/div/div[2]/form/div/div[4]/div[1]/div[3]/div/div/div/input"

        # 元素：查看
        self.view_details = By.XPATH, "//*[@class='ivu-table-fixed-body']/table/tbody/tr[1]/td[1]/div/div/a[1]"
        # 元素：收费信息
        self.fee_based_content = By.XPATH, "//*[text()=' 收费信息 ']"
        # 元素：作废计费单
        self.cancel_bill = By.XPATH, "//*[text()='作废']"
        # 元素：确定
        self.cancel_confirm = By.XPATH, "//*[@class='ivu-modal-confirm-body']/following-sibling::div/button[2]"
        # 元素：订单收费
        self.detail_order_charge = By.XPATH, "//*[text()='订单收费']"
        self.detail_charge_success = By.XPATH, "//*[text()='收费成功！']"
        # 元素：订单作废成功
        self.successful_cancellation = By.XPATH, "//*[text()='作废成功']"
        # 元素：推送
        self.push_order = By.XPATH, "//*[text()='推送']"
        # 元素：推送成功
        self.push_succese = By.XPATH, "//*[text()='推送成功']"
        # 元素：变动
        self.change = By.XPATH, "//*[text() = '变动']"
        # 元素：考期
        self.date_examination1 = By.XPATH, "//label[@class='ivu-form-item-label'and text() = '考期：']/following-sibling::div/div/div[1]/div/input"
        # 元素：变动-保存
        self.change_save = By.XPATH, "//*[@class='ivu-modal-header-inner'and text()='订单变动']/../following-sibling::div[2]/div/button[1]"
        # 元素：变动-确定
        self.change_confire = By.XPATH, "//*[@class='ivu-modal-confirm-body']/../div[3]/button[2]"
        # 元素：变动成功
        self.change_sucess = By.XPATH, "//*[text()='变动成功']"
        # 元素：修改
        self.change_info = By.XPATH, "//*[text()='修改']"
        # 元素：业务归属人
        self.business_owner = By.XPATH, "//*[text()='业务归属人']/../div/div/div[1]/div/input"
        # 元素：修改-保存
        self.alter_save = By.XPATH, "//*[text()='编辑基础信息']/../following-sibling::div[2]/div/button[1]"
        # 元素：修改成功
        self.alter_suceess = By.XPATH, "//*[text()='修改成功']"
        # 元素：作废订单
        self.cancelled_order = By.XPATH, "//*[text()='作废订单']"
        # 元素：作废订单-确定
        self.cancell_confire = By.XPATH, "//*[@class='ivu-modal-confirm-footer']/button[2]"
        # 元素：作废成功
        self.successful_cancellation = By.XPATH, "//*[text()='作废成功']"
        # 元素：导入订单
        self.import_order = By.XPATH, "//*[@class='ivu-form ivu-form-label-right ivu-form-inline']/div[17]/div/button[3]"
        # 选择文件
        self.select_file = By.XPATH, "//*[text()='选择文件']"
        # 元素：确定
        self.import_confirmation = By.XPATH, "//*[@class='formItem clearfix']/../../following-sibling::div/div/button[1]"
        # 元素：任务已提交，点击“查看导入文件”查看导入结果
        self.task_submitted = By.XPATH, "//*[text()='任务已提交，点击“查看导入文件”查看导入结果']"
        # 元素：刷新
        self.refresh_page = By.XPATH, "//*[text()='刷新']"

        # 元素：计费单列表
        self.billing_list = By.XPATH, "//*[contains(text(),'计费单列表')]"
        # 元素：选择计费单
        self.selective_billing = By.XPATH, "//*[@class='ivu-table-body ivu-table-overflowX ivu-table-overflowY']/table/tbody/tr[1]/td[1]/div/label/span/input"
        # 元素：红冲
        self.red_punch = By.XPATH, "//*[text()='红冲']"
        # 元素：红冲-确定
        self.red_confirm = By.XPATH, "//*[@class='ivu-modal-confirm-body']/following-sibling::div/button[2]"
        # 元素：已红冲
        self.red_stamp = By.XPATH, "//*[text()='已红冲']"





    @allure.step(title="操作步骤:点击查看")
    def click_check(self):
        return self.click(self.view_details)   # 点击查看

    @allure.step(title="操作步骤:作废计费单流程")
    def click_cancel_bill(self):
        self.click(self.fee_based_content)  # 点击收费信息
        self.find_els(self.cancel_bill)[1].click()  # 作废计费单
        self.click(self.cancel_confirm)     # 点击确定

    @allure.step(title="操作步骤:获取’作废成功‘文本")
    def get_successful_cancellation(self):
        return self.find_el(self.successful_cancellation).text   # 获取文本’作废成功‘

    @allure.step(title="操作步骤:订单收费")
    def click_detail_order_charge(self):
        return self.click(self.detail_order_charge)   # 订单收费

    @allure.step(title="操作步骤:获取'收费成功'文本")
    def click_detail_charge_successe(self):
        return self.find_el(self.detail_charge_success).text   # 获取订单收费成功文本

    @allure.step(title="操作步骤:点击推送订单成功")
    def click_push_order(self):
        return self.click(self.push_order)  # 点击推送

    @allure.step(title="操作步骤:获取'推送成功'")
    def get_check_push1(self):
        return self.find_el(self.push_succese).text     # 获取'推送成功'文本

    @allure.step(title="操作步骤:变动流程")
    def click_order_change(self):
        self.click(self.change)    # 点击变动
        self.click(self.date_examination1)   # 点击考期
        BaseCommon.choose_1st_select(self)  # 选择下拉第一个考期
        self.click(self.change_save)    # 点击保存
        self.click(self.change_confire)  # 点击确定

    @allure.step(title="操作步骤:获取'变动成功'文本")
    def get_change_sucess(self):
        return self.find_el(self.change_sucess).text    # 获取'变动成功'

    @allure.step(title="操作步骤:获取'变动成功'文本")
    def click_business_owner(self,business_name):
        self.click(self.change_info)    # 点击修改
        self.click(self.business_owner)    # 点击修改
        time.sleep(2)
        self.clear(self.business_owner)  # 清空名字
        self.input(self.business_owner, business_name)  # 输入业务归属人
        BaseCommon.choose_1st_select(self)  # 选择下拉第一个业务归属人
        self.click(self.alter_save)  # 点击保存

    @allure.step(title="操作步骤:获取'修改成功'文本")
    def get_alter_suceess(self):
        return self.find_el(self.alter_suceess).text    # 获取'修改成功'


    @allure.step(title="操作步骤:作废订单")
    def click_cancelled_order(self):
        self.click(self.cancelled_order)    # 点击作废订单
        self.click(self.cancell_confire)    # 点击确定

    @allure.step(title="操作步骤:获取'作废成功'文本")
    def get_successful_cancellation(self):
        return self.find_el(self.successful_cancellation).text    # 获取'作废成功'



    @allure.step(title="操作步骤:点击订单管理")
    def click_order_management(self):
        return self.click(self.menu_order_management)

    @allure.step(title="操作步骤:点击订单列表")
    def click_menu_order_list(self):
        return self.click(self.menu_order_list)

    @allure.step(title="操作步骤:点击创建订单")
    def click_create_order(self):
        return self.click(self.create_order)


    @allure.step(title="操作步骤：创建线下订单流程")
    def click_create_all(self, name, product_name,examination_name,project_type):
        self.input(self.student_name, name)  # 输入学员名字
        phone_numbe = BaseCommon.create_phone(self) # 自动生成手机号
        self.input(self.student_number, phone_numbe)  # 输入学员手机号
        time.sleep(0.5)
        self.find_els(self.certificate_type)[0].click()     # 点击证件号下拉框
        time.sleep(0.5)
        self.click(self.select_protection)  # 选择护照
        doc_number = BaseCommon.create_card(self)   # 自动生成证件号
        self.input(self.document_number,doc_number)     # 输入自动生成的证件号
        self.find_els(self.certificate_type)[1].click()  # 点击业务归属人下拉框
        self.click(self.business_owner)     # 选择业务归属人
        self.click(self.Offline_charging)    # 选择线下收费
        self.click(self.additive_product)   # 点击添加产品
        self.click(self.provinces_down_box)     # 点击选择报考省份下拉框
        self.click(self.select_province)    # 选择广东
        self.click(self.city_dropdown_box)  # 点击选择报考城市下拉框
        self.find_els(self.select_city)[1].click()  # 选择广州
        self.click(self.select_project_type)    # 点击项目类型输入框
        self.input(self.select_project_type, project_type)  # 输入项目类型
        BaseCommon.choose_1st_select(self)  # 选择下拉第一个产品
        self.input(self.select_product, product_name)  # 输入产品名称
        BaseCommon.choose_1st_select(self)  # 选择下拉第一个产品
        self.click(self.date_examination)   # 点击报考考期选择框
        self.input(self.date_examination, examination_name)     # 输入考期名称
        BaseCommon.choose_1st_select(self)  # 选择下拉第一个考期名称
        self.click(self.save_confirm)   # 点击确定
        self.click(self.confirm_order)  # 点击确认订单

    @allure.step(title="操作步骤:获取创建订单成功文本")
    def created_successfully_text(self):
        return self.find_el(self.created_successfully).text


    @allure.step(title="操作步骤：创建线上订单流程")
    def click_create_all_01(self, name, product_name,examination_name,project_type,price):
        self.input(self.student_name, name)  # 输入学员名字
        phone_numbe = BaseCommon.create_phone(self) # 自动生成手机号
        self.input(self.student_number, phone_numbe)  # 输入学员手机号
        time.sleep(0.5)
        self.find_els(self.certificate_type)[0].click()     # 点击证件号下拉框
        time.sleep(0.5)
        self.click(self.select_protection)  # 选择护照
        doc_number = BaseCommon.create_card(self)
        self.input(self.document_number,doc_number)     # 自动生成证件号
        self.find_els(self.certificate_type)[1].click()  # 点击业务归属人下拉框
        self.click(self.business_owner)     # 选择业务归属人
        self.click(self.online_order)    # 选择线上收费
        self.click(self.additive_product)   # 点击添加产品
        self.click(self.provinces_down_box)     # 点击选择报考省份下拉框
        self.click(self.select_province)    # 选择广东
        self.click(self.city_dropdown_box)  # 点击选择报考城市下拉框
        self.find_els(self.select_city)[1].click()  # 选择广州
        self.click(self.select_project_type)    # 点击选择项目类型
        self.input(self.select_project_type, project_type)  # 输入项目类型
        BaseCommon.choose_1st_select(self)  # 选择下拉第一个项目类型
        self.input(self.select_product, product_name)  # 输入产品名称
        BaseCommon.choose_1st_select(self)  # 选择下拉第一个产品
        self.click(self.date_examination)   # 点击报考考期选择框
        self.input(self.date_examination, examination_name)     # 输入考期名称
        BaseCommon.choose_1st_select(self)  # 选择下拉第一个考期名称
        self.click(self.save_confirm)   # 点击确定
        self.input(self.transaction_price,price)    # 输入成交价
        self.click(self.confirm_order)  # 点击确认订单
        time.sleep(0.5)

    @allure.step(title="操作步骤:点击订单收费")
    def click_order_charge(self):
        return self.click(self.order_charge)



    @allure.step(title="操作步骤:订单收费流程")
    def click_manual_charge(self,prie1):
       self.click(self.collection_manner)   # 点击收费方式
       self.click(self.manual_charge)   # 选择手动收费
       self.click(self.nature_charge)   # 点击收费性质
       BaseCommon.choose_1st_select(self)  # 选择下拉第一个收费性质
       self.input(self.charge_amount, prie1)     # 输入收费价格
       self.click(self.pay_payee)    # 点击收款方
       self.click(self.select_recipient)    # 选择测试校区
       time.sleep(0.5)
       element = self.find_el(self.collection_channel)
       self.driver.execute_script("arguments[0].scrollIntoView();", element)    # 向下滑动至元素可见
       self.click(self.collection_channel_1)  # 点击收款渠道
       time.sleep(0.5)
       self.click(self.select_collection)    # 选择测试渠道
       time.sleep(0.5)
       self.click(self.confirm_receipt)     # 点击确认收费

    @allure.step(title="操作步骤:获取收费成功文本")
    def get_charge_success(self):
        # return self.find_el(self.charge_success).text
        element = self.find_el(self.charge_success)
        self.driver.execute_script("arguments[0].text();", element)


    @allure.step(title="操作步骤:申请售后--异动换产品流程")
    def click_after_servicet(self, explain, money, product_name, price):
        self.click(self.after_sales)    # 点击申请售后
        self.input(self.deduction_statement, explain)   # 输入扣费说明
        self.input(self.amount_deduction, money)    # 扣费金额
        self.click(self.next_step)  # 点击下一步
        time.sleep(0.5)
        self.click(self.partner_campus)     # 选择合作小区
        time.sleep(0.5)
        BaseCommon.choose_1st_select(self)  # 选择下拉第一个合作校区
        time.sleep(0.5)
        self.input(self.shopping_goods, product_name)  # 输入产品名称
        time.sleep(1)
        BaseCommon.choose_1st_select(self)  # 选择下拉第一个产品
        time.sleep(1)
        self.click(self.applicant_province)     # 点击报考省份
        time.sleep(1)
        BaseCommon.choose_1st_select(self)  # 选择下拉第一个省份
        self.click(self.applicant_city)     # 点击报考城市
        BaseCommon.choose_1st_select(self)  # 选择下拉第一个省份
        self.input(self.order_amount, price)     # 输入订单金额
        self.click(self.refund_no)
        self.click(self.next_step1)     # 点击下一步
        # time.sleep(3)
        # self.click(self.personal_refund)
        # self.input(self.personal_refund, money)  # 输应退个人金额
        # time.sleep(1)
        # self.click(self.save_success)   # 点击保存

    @allure.step(title="操作步骤:获取保存成功")
    def get_time_application(self):
        return self.find_el(self.time_application).text



    @allure.step(title="操作步骤:点击仅退款")
    def click_refund_only(self, explain, money1, payee, account):
        self.click(self.after_sales)    # 点击申请售后
        self.click(self.refund_only)     # 点击仅退款tab
        self.input(self.only_dable_amount, explain)    # 输入仅退费-扣费说明
        self.input(self.only_dable_amoun, money1)  # 输入仅退费-应退个人金额
        self.input(self.only_payee, payee)    # 输入仅退费-收款方
        self.click(self.only_ollection_channel)  # 点击仅退费-收款渠道
        BaseCommon.choose_1st_select(self)  # 选择下拉第一个仅退费-收款渠道
        self.input(self.only_account_number, account)  # 输入收款账号
        self.click(self.returnt_save)   # 点击保存



    @allure.step(title="操作步骤:点击退学退费流程")
    def click_withdrawal_fee(self, explain, money1, payee, account):
        self.click(self.after_sales)    # 点击申请售后
        self.click(self.withdrawal_fee)     # 点击退学退费tab
        self.input(self.refund_instructions, explain)    # 输入扣款说明
        self.input(self.refun_dable_amount, money1)  # 输入应退个人金额
        self.input(self.return_payee, payee)    # 输入收款方
        self.click(self.returt_collection_channel)  # 点击收款渠道
        BaseCommon.choose_1st_select(self)  # 选择下拉第一个渠道
        self.input(self.return_account_number, account)  # 输入收款账号
        self.click(self.returnt_save)   # 点击保存


    @allure.step(title="操作步骤:导入订单流程")
    def click_import_file(self,file_path):
        BaseCommon.generateStu1(self)   # 自动修改导入订单文件内容
        self.click(self.import_order)  # 点击导入订单按钮
        self.click(self.select_file)    # 选择文件
        time.sleep(5)
        BaseCommon.upload_file(self,file_path)  # 原生上传文件
        self.click(self.import_confirmation)  # 弹窗，点击确认

    @allure.step(title="操作步骤:获取导入订单文案")
    def get_task_submitted(self):
        return self.find_el(self.task_submitted).text   # 获取导入订单文本

    @allure.step(title="操作步骤:点击刷新")
    def click_refresh_page(self):
        return self.click(self.refresh_page)   # 点击刷新

    @allure.step(title="操作步骤:获取列表计费单已红冲")
    def click_billing_list(self):
        return self.click(self.billing_list)   # 获取计费单列表第一条已红冲字段

    @allure.step(title="操作步骤:从frame中切换到主界面")
    def swich_default(self):
        return self.switch_to_default()  # 从frame中切换到主界面

    @allure.step(title="操作步骤:计费单红冲流程")
    def click_billing_processself(self):
        self.click(self.selective_billing)    # 点击复选框选择第一条计费单
        self.click(self.red_punch)  # 点击红冲
        self.click(self.red_confirm)    # 点击确定

    @allure.step(title="操作步骤:获取列表计费单已红冲")
    def get_red_stamp(self):
        return self.find_els(self.red_stamp)[1].text    # 获取计费单列表第一条已红冲字段




